var t = require;
var e = module;
var o = exports;
var n =
        (this && this.__extends) ||
        (function () {
            var t = function (e, o) {
                return (t =
                    Object.setPrototypeOf ||
                    ({__proto__: []} instanceof Array &&
                        function (t, e) {
                            t.__proto__ = e;
                        }) ||
                    function (t, e) {
                        for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
                    })(e, o);
            };
            return function (e, o) {
                function n() {
                    this.constructor = e;
                }
                t(e, o), (e.prototype = null === o ? Object.create(o) : ((n.prototype = o.prototype), new n()));
            };
        })(),
    r =
        (this && this.__decorate) ||
        function (t, e, o, n) {
            var r,
                a = arguments.length,
                i = a < 3 ? e : null === n ? (n = Object.getOwnPropertyDescriptor(e, o)) : n;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(t, e, o, n);
            else
                for (var s = t.length - 1; s >= 0; s--)
                    (r = t[s]) && (i = (a < 3 ? r(i) : a > 3 ? r(e, o, i) : r(e, o)) || i);
            return a > 3 && i && Object.defineProperty(e, o, i), i;
        };
Object.defineProperty(o, "__esModule", {value: !0});
var a = t("View"),
    i = t("DayGem"),
    s = t("FriendHelp"),
    c = t("Hutuiqiang"),
    l = t("Platforms"),
    u = t("signin"),
    p = t("setup"),
    f = t("bank"),
    d = t("giftBag"),
    h = t("luckdraw"),
    y = t("AddToFavorite"),
    g = t("Const"),
    v = t("GiftCode"),
    m = cc._decorator,
    _ = m.ccclass,
    A =
        (m.property,
        (function (t) {
            function e() {
                var e = (null !== t && t.apply(this, arguments)) || this;
                return (e.res = "topBar"), (e.zIndex = 1), e;
            }
            return (
                n(e, t),
                (e.prototype.onEnable = function () {
                    var t = this.find("btns"),
                        e = this.find("setup");
                    (this.buttonActive = function (o) {
                        (t.active = o), (e.active = o);
                    }),
                        (g.default.收藏有礼 = cc.find("btns/收藏有礼", this.view)),
                        (l.default.platformCtrl.显示收藏有礼 && "已领取奖励" != l.default.userStorage.收藏) ||
                            g.default.隐藏收藏有礼按钮(),
                        (g.default.添到桌面 = cc.find("btns/添到桌面", this.view)),
                        (l.default.platformCtrl.显示添到桌面 && !l.default.userStorage.已添到桌面) ||
                            g.default.隐藏添到桌面按钮();
                }),
                (e.prototype.onClick = function (t) {
                    switch (t) {
                        case "03":
                            if ("4399小游戏" == l.default.platformType) return;
                            l.default.popups.show(v.GiftCode);
                            break;
                        case "goldAdd":
                            this.showView("goldAdd");
                            break;
                        case "diamondAdd":
                            this.showView("diamondAdd");
                            break;
                        case "setup":
                            this.showView(p.default);
                            break;
                        case "signin":
                            this.showView(u.default);
                            break;
                        case "luckdraw":
                            this.showView(h.default);
                            break;
                        case "gift":
                            this.showView(d.default);
                            break;
                        case "FriendHelp":
                            l.default.popups.show(s.FriendHelp);
                            break;
                        case "试玩领奖":
                            l.default.popups.show(c.Hutuiqiang);
                            break;
                        case "更多游戏":
                            l.default.platformCtrl.showMoreGamesModal();
                            break;
                        case "盒子广告":
                            l.default.platformCtrl.showAppBox();
                            break;
                        case "bank":
                            this.showView(f.default);
                            break;
                        case "DayGem":
                            l.default.popups.show(i.DayGem);
                            break;
                        case "收藏有礼":
                            l.default.popups.show(y.AddToFavorite);
                            break;
                        case "添到桌面":
                            l.default.platformCtrl.saveAppToDesktop();
                    }
                }),
                (e = r([_], e))
            );
        })(a.default));
o.default = A;
